package com.example.clickhouse;

import org.apache.flink.streaming.api.functions.sink.SinkFunction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ClickHouseSink implements SinkFunction<String> {

    @Autowired
    private ClickHouseService clickHouseService;

    @Override
    public void invoke(String value, Context context) {
        clickHouseService.insertData(value);
    }
}